# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kcalendarcore5
pkgver=5.116.0
pkgrel=0
pkgdesc="The KDE calendar access library"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later"
depends_dev="
	libical-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc"
_repo_url="https://invent.kde.org/frameworks/kcalendarcore.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kcalendarcore-$pkgver.tar.xz"
options="!check" # RecursOn-ConnectDaily(2|3|6) make the builders stuck
builddir="$srcdir/kcalendarcore-$pkgver"

replaces="kcalcore kcalendarcore<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# testrecurtodo, testreadrecurrenceid, testicaltimezones, testmemorycalendar and testtimesininterval are broken
	ctest --test-dir build --output-on-failure -E "test(recurtodo|readrecurrenceid|icaltimezones|memorycalendar|timesininterval)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
04fc6b6c00e2a994b47b15e57a531b51439d67155b90c388b4e37efb6428e0215e90ff52bb5afa55d0ee0e7cb75186eac750770c9036824c20b779ef418bd1c0  kcalendarcore-5.116.0.tar.xz
"
